package com.universalInterface.lims_interface.controller;


import cn.hutool.core.bean.BeanUtil;
import com.universalInterface.common.result.ApiResult;
import com.universalInterface.lims_interface.entity.TestConclusion;
import com.universalInterface.lims_interface.service.ITestConclusionService;
import com.universalInterface.lims_interface.vo.api.TestConclusionParamVos;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * <p>
 * 实验室测试报告数据结论
 * </p>
 *
 * @author author
 * @since 2023-12-19
 */
@Tag(name = "实验室测试报告数据结论")
@Validated
@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/testConclusion")
public class TestConclusionController {

    private final ITestConclusionService iTestConclusionService;
    @PostMapping("/addConclusion")
    @Operation(summary = "新增评论")
    public ApiResult add(@Parameter(name = "报告的评论",description = "报告评论的填写") @Valid @RequestBody TestConclusionParamVos  testConclusionParamVos){
        TestConclusion testConclusion = iTestConclusionService.add(BeanUtil.copyProperties(testConclusionParamVos,TestConclusion.class));
        return ApiResult.success("添加成功");
    }
}
